package app.mvc.view.layers
{
	import alternativa.gui.base.GUIobject;
	import alternativa.gui.container.Container;
	import alternativa.gui.container.SimpleContainer;
	import alternativa.gui.layout.IStageSizeListener;
	
	import flash.display.Graphics;
	
	import loaders.XLoader;
	
	import utils.UtilsGC;
	
	/**
	 * 背景层
	 * @author xiling
	 */
	public class BackgroundLayer extends Container implements IStageSizeListener
	{
		private var bgLoader:XLoader;
		public function BackgroundLayer()
		{
			super();
		}
		
		public function changeBackground($url:String):void
		{
			UtilsGC.clearObject(bgLoader);
			bgLoader = new XLoader($url);
			addChild(bgLoader);
		}
		
		override protected function draw():void
		{
			// TODO Auto Generated method stub
			super.draw();
			
			var graphics:Graphics = graphics;
			graphics.beginFill(0xffffff);
			graphics.drawRect(0,0,width,height);
			graphics.endFill();
		}
		
	}
}